<?php
/**
 * CakeCMS后台 - 城市model
 * 
 * @author zzdboy
 * @version 1.0
 */
class City extends AppModel {
	public $name = 'City';
	public $useTable = 'city';
	public $primaryKey = 'id';
	
	/**
	 * 根据城市ID获取城市相关信息
	 *
	 * @param int $id        	
	 */
	public function GetCityByID($id) {
		$CityInfo = $this->find ( 'first', array (
				'conditions' => array (
						'id' => $id 
				) 
		) );
		return $CityInfo;
	}
	
	/**
	 * 城市列表
	 *
	 * @param array $conditions        	
	 */
	public function GetCityByList($conditions = array()) {
		$list = $this->find ( 'all', array (
				'conditions' => $conditions,
				'order' => 'sort ASC' 
		) );
		return $list;
	}
}
?>